//
//  MyWalletViewModel.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/5.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "MyWalletViewModel.h"
#import "MyWalletBackView.h"

@implementation MyWalletViewModel

- (instancetype)initWithSuperView:(UIView *)superView
{
    if (self = [super initWithSuperView:superView]) {
        
        MyWalletBackView *view = [[MyWalletBackView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight ) inSuperView:superView];
        if (iPhoneX) {
            view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight - kHeightProportion_In_iPhoneTriploid(34));
        }
        
        kWeakSelf(self);
        view.BlockBtn = ^(GLGWButton * _Nullable btn) {
            [weakself btnAction:btn];
        };
        view.BlockLeftBtn = ^(GLGWButton * _Nullable leftbtn) {
            [weakself leftAction:leftbtn];
        };
        
    }
    return self;
}

- (void)btnAction:(GLGWButton *)sender
{
    if (self.BlockBtn) {
        self.BlockBtn(sender);
    }
}

- (void)leftAction:(GLGWButton *)sender
{
    if (self.BlockLeftBtn) {
        self.BlockLeftBtn(sender);
    }
}


@end
